package com.macro.mall.model;

import cn.hutool.json.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * dom_ld_area_cd_prov实体类
 *
 * @author gaodx
 *
 */
@Data
@Builder
@AllArgsConstructor
public class DomLdAreaCdProv implements Serializable{
	/**id*/
    @ApiModelProperty(value = "id")
	private Integer id; 
	/**区号*/
    @ApiModelProperty(value = "区号")
	private String ldAreaCd; 
	/**省份*/
    @ApiModelProperty(value = "省份")
	private String provCd;
	/**对应的地市中文名称*/
    @ApiModelProperty(value = "对应的地市中文名称")
	private String ldAreaNm; 
	/**开始启用时间*/
    @ApiModelProperty(value = "开始启用时间")
	private Date effcTm; 
	/**停止使用时间*/
    @ApiModelProperty(value = "停止使用时间")
	private Date expiredTm; 
	/**数据更新时间*/
    @ApiModelProperty(value = "数据更新时间")
	private Date updatetime; 
	/**
	 * 实例化
	 */
	public DomLdAreaCdProv() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */

	public DomLdAreaCdProv(JSONObject obj) {
		this();
		if (obj.get("id") instanceof Number) {
			this.setId(((Number) obj.get("id")).intValue());
		}
		if (obj.get("ldAreaCd") instanceof String) {
			this.setLdAreaCd((String) obj.get("ldAreaCd"));
		}
		if (obj.get("provCd") instanceof Number) {
			this.setProvCd(((String) obj.get("provCd")));
		}
		if (obj.get("ldAreaNm") instanceof String) {
			this.setLdAreaNm((String) obj.get("ldAreaNm"));
		}
		this.setEffcTm((Date) obj.get("effcTm"));
		this.setExpiredTm((Date) obj.get("expiredTm"));
		this.setUpdatetime((Date) obj.get("updatetime"));
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getLdAreaCd() != null) {
			result.put("ldAreaCd",this.getLdAreaCd());
		}
		if (this.getProvCd() != null) {
			result.put("provCd",this.getProvCd());
		}
		if (this.getLdAreaNm() != null) {
			result.put("ldAreaNm",this.getLdAreaNm());
		}
		if (this.getEffcTm() != null) {
			result.put("effcTm",this.getEffcTm());
		}
		if (this.getExpiredTm() != null) {
			result.put("expiredTm",this.getExpiredTm());
		}
		if (this.getUpdatetime() != null) {
			result.put("updatetime",this.getUpdatetime());
		}
		return result;
	}


	@Override
	public String toString() {
		return "DomLdAreaCdProv [id=" + id + " , ldAreaCd=" + ldAreaCd + " , provCd=" + provCd + " , ldAreaNm=" + ldAreaNm + " , effcTm=" + effcTm + " , expiredTm=" + expiredTm + " , updatetime=" + updatetime + "  ]";
	
	}
	
	
}
